home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 1 / Precision Software Applications Silver Collection Volume One (PSM) (1993).iso / games / egavga / ginrummy.arj / GINRUMMY.DOC < prev    next >
Text File  |  1992-01-14  |  23KB  |  497 lines

  1. ===================
  2.  
  3.      GinRummy
  4.  
  5.        from
  6.  
  7. Universal Software
  8.  
  9. -------------------
  10.  
  11.   Copyright 1991
  12.  
  13.        by
  14.  
  15.    David Teach
  16.  
  17. -------------------
  18.  
  19.    Version 3.0
  20.  
  21. ===================
  22.  
  23.  
  24. Requirements / Recommendations to play  
  25. ======================================
  26.  
  27. An EGA or VGA graphics card with at least 256k is required.
  28.  
  29. A Microsoft, Logitech, or compatible mouse is recommended.
  30. Three button rodents work better for the hint feature.
  31.  
  32. An IBM or compatible AT computer with 8 mHz or faster 
  33. CPU speed is also recommended.
  34.  
  35.  
  36. Rules of the Game  -  Taken from "Official Rules of Card Games",
  37. =================     62nd edition, U.S Playing Card Company, 1968
  38.  
  39. Rank of cards:
  40.      (High) K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3, 2, A.
  41.  
  42. Value of cards:
  43.      Face cards 10, Ace 1, other cards their pip value.
  44.  
  45. The Deal:
  46.      Each player is dealt 10 cards, the next card is turned face
  47. up, forming the discard pile.  The rest of the deck is placed
  48. beside it, face down.
  49.  
  50. Object of play:
  51.      To form MATCHED SETS, consisting of three or four of a kind,
  52. or sequences of three or more cards of the same consecutive rank
  53. in the same suit.
  54.  
  55. The Play:
  56.      The human player and the computer take turns by drawing a
  57. card from either the deck or the top of the discard pile, then
  58. choosing a card from their hand to discard.  In this game, you
  59. always go first.  Players alternate until:
  60.  
  61.      1) A player can GIN.
  62.      2) A player KNOCKS.
  63.      3) Only 2 cards are left in the deck.
  64.  
  65. A Draw:
  66.      If only two cards remain in the deck at the start of a turn,
  67. a player may choose a card from the discard pile and continue his
  68. turn; but if either player draws from the deck, the hand is a draw.
  69. No points are scored for a draw hand, the cards are re-shuffled
  70. and dealt again for a new hand.
  71.  
  72.      The number of cards left in the deck is shown as a small
  73. white number on the top of the deck.  If the number or cards left
  74. is 7 or lower, the number on the deck will be red instead of white.
  75.  
  76. GIN:
  77.      If after discarding, all of the remaining cards in the
  78. player's hand are formed into matched sets, the player has GIN.
  79. This scores 25 points, plus the value of his opponent's unmatched
  80. cards (deadwood).
  81.  
  82. KNOCK:
  83.      A player can KNOCK if, after discarding, the total of his
  84. unmatched cards is 10 points or less.  He does not have to knock
  85. when able to do so.  After knocking, the hand is over, and both
  86. players count the points of their unmatched (deadwood) cards.
  87. The other player (non-knocking) does not count the points of any
  88. deadwood card he can play on the knocking player's MATCHED SETS.
  89. This is called LAYING OFF.  The knocking player CANNOT lay off any
  90. of his deadwood cards, and the player laying off CANNOT alter his
  91. or his opponent's matched sets in order to lay off more cards, or
  92. combine his and the other player's deadwood cards to form matched
  93. sets.  If, after laying off, the knocking player has FEWER points
  94. than his opponent, he scores the difference in points.  If the
  95. non-knocking player has LESS or MORE points than his opponent, he
  96. has UNDERCUT him and scores 25 points, plus the point difference
  97. in unmatched cards. (If you can't remember all this, don't worry;
  98. the computer does all the laying-off and counting for you.)
  99.  
  100. OKLAHOMA:
  101.      If the Oklahoma option is on, play is the same except that
  102. the value of the first card on the discard pile (the upcard),
  103. determines the knock value, whether it is taken or not.  That
  104. means, if the first upcard is a 5, then the players can only knock
  105. if they have 5 points or less in deadwood cards.  If an ACE is the
  106. first upcard, a player must GIN to win the hand.  If the first 
  107. upcard is a SPADE, all points scored in that hand are DOUBLED.
  108. To remind you if this, a RED box will be drawn around the knock
  109. card when the first upcard is a spade.
  110.  
  111. Winning:
  112.      Play continues until a player's accumulated score is greater
  113. or equal to the agreed scoring limit, usually 100.  You can then
  114. quit the game or play a new game from zero.
  115.  
  116.  
  117. How to play this computer game
  118. ==============================
  119. When in keyboard play, the numbers or letters for the commands are
  120. highlighted in light green.  When using the mouse, commands are
  121. selected with either the Left or Right mouse buttons.  The center
  122. button or both left and right buttons together will ask for a hint.
  123. When using the keyboard, the letter H brings up the hint suggestion.
  124.  
  125. WARNING: if you are using both left and right mouse buttons to ask
  126. for hints, you must make sure that the mouse pointer is NOT OVER 
  127. a regular choice area, (deck, card in hand, quit, etc.) or else 
  128. the game will usually think that you made a normal choice with a
  129. single button.  If you have a center button, use that instead; this 
  130. will work for hints ANYWHERE on the screen, even over normal choice 
  131. areas.
  132.  
  133. ***** Note *****
  134. The keyboard commands are only possible if a mouse is not detected,
  135. or if you are in forced keyboard mode; otherwise, the mouse is the
  136. default selecting device.
  137.  
  138.  
  139. The Title Screen:
  140.  
  141. BEGIN GAME -
  142.      Typing 'B' or clicking the left or right mouse button on
  143.      the BEGIN GAME box starts the game with the shown options.
  144.      Hitting ENTER will also choose this.
  145.  
  146. OPTIONS -
  147.      Typing 'O' or clicking on OPTIONS will bring up the game
  148.      Options Menu. (see below)
  149.  
  150. HIGH SCORES -
  151.      This displays the top 20 high scores list.
  152.  
  153. QUIT -
  154.      QUIT will exit the program.
  155.  
  156.  
  157. The Options Menu:
  158.  
  159. MAIN MENU -
  160.      This option will bring you back to the main menu. (Title screen)
  161.      You can hit the letter M, the ENTER key, or ESCAPE key to
  162.      select this in keyboard mode.
  163.  
  164. NAME -
  165.      The default name is 'PLAYER'.  You can change this by typing 'N'
  166.      or clicking the mouse pointer within the red box around the name,
  167.      typing a new name, and pressing ENTER (or a mouse button).  
  168.      Backspace is the only editing key allowed if you make an error 
  169.      while typing in the name.  Upper and lower case letters, numbers 
  170.      1 through 9, characters  ! . , " - : / ?,  and spaces are also 
  171.      allowed.  The name can be a maximum of 8 characters long.
  172.  
  173. SORT BY -
  174.      This toggles the sorting of the unmatched cards in your hand:
  175.        RANK = Unmatched cards are arranged highest to lowest, regardless
  176.               of suit.  Cards of same value are then arranged by suit.
  177.        SUIT = Unmatched cards are arranged highest to lowest within
  178.               the four possible suits.  Suit order is: Spades, Hearts,
  179.               Diamonds, Clubs. (Bridge order)
  180.  
  181. SCORE LIMIT -
  182.      Clicking on SCORE LIMIT cycles the maximum score to play to
  183.      by 50 points, from 0 to 500.  Or by 50 points added on to,
  184.      or subtracted from, any command line score limit you give.
  185.      The RIGHT mouse button, or '+' INCREASES the score by 50, and
  186.      the LEFT mouse button, or '-' DECREASES the score by 50.
  187.  
  188. OKLAHOMA -
  189.      Changing the OKLAHOMA option to YES will play the game by
  190.      Oklahoma rules. (see rules above)  The double points on 
  191.      a spade as first upcard is still in effect even if knocking
  192.      is disabled.
  193.  
  194. BIG CARDS -
  195.      The default card set has somewhat realistic-looking cards,
  196.      but it can be a little hard to distinguish between the suits
  197.      on some video cards.  Changing this option to YES will give you
  198.      cards with one big number and one big symbol for the suit.
  199.  
  200.      If the shapes of the suits do not look good to you, it is the
  201.      fault of your computer's built in default character set.  I 
  202.      improved on the Diamond, but the other suits are too complicated
  203.      for quick drawing and filling.  (maybe a later fix)
  204.  
  205. EASY GAME -
  206.      If the computer is too hard for you, toggle EASY to YES.  This
  207.      will make the computer always pick the largest value unused 
  208.      card in his hand for discarding instead of following its better
  209.      choosing formulas.
  210.  
  211. KNOCKING -
  212.      If this option is YES, you are allowed to knock if possible.
  213.      (See knock rules above)  Otherwise you must GIN to win a hand.
  214.      If knocking is disabled, a zero will be drawn for the knock
  215.      card value instead of the normal knock value.
  216.  
  217. POINTER -
  218.      Clicking on this option will change the shape of the mouse
  219.      pointer.  There are seven different shapes to choose from.
  220.      Obviously, this will not have any effect if the mouse driver
  221.      is disabled or not present.
  222.  
  223. SAVE -
  224.      Selecting SAVE will save all options to the GINRUMMY.CFG file.
  225.      This file is loaded when the program is run, so your name and 
  226.      favorite options are already set.  If this file is not present,
  227.      or is corrupted, it will be created with the default options.
  228.  
  229.  
  230. Command Line Options:
  231.      The default setting for the two options NAME and SCORE LIMIT 
  232. can be set from the command line, overriding the configuration file
  233. settings.  At the DOS prompt, you can do the following:
  234.  
  235. To set the SCORE LIMIT: GINRUMMY <nnn>   -- where <nnn> is a number 
  236.    from 000 to 999.  ex. GINRUMMY 234
  237.  
  238. For numbers less than 100, you MUST use leading zeros.  ex. 025
  239.  
  240. If the limit is 0, then exactly one hand will be played, even if
  241.    it is a draw.
  242.  
  243. To have the game use your name instead of the default name, you 
  244.    can state it as a command line option.  ex. GINRUMMY Dave
  245.  
  246. For the Command line option of Player Name, the length limit is 8 
  247.    characters and the name must be one word.  You can use BobSmith, 
  248.    or Ron_Hill, etc., but typing Paul Schoenberger will give you 
  249.    Schoenbe for your name.  If you want a space in your name, you 
  250.    can put one in only with the Name Change from the options menu.
  251.  
  252. The name used is the LAST word on the command line that is NOT 
  253.    otherwise recognized as a command, so be sure not to have any 
  254.    gibberish on the line when you start the game: 
  255.    GINRUMMY Mike ASDF  will make your name ASDF not Mike.  
  256.  
  257. To force the game to play in keyboard mode when a mouse is detected,
  258.    use the command line option KEYBOARD to enable keyboard play.
  259.    *** Be careful of mixing keyboard and mouse play.  Since this
  260.    game will automaticly select keyboard mode if a mouse is not
  261.    detected, this option should only be used if a mouse is falsely
  262.    detected on your computer, or you can't turn off your mouse and
  263.    you need to play using the keyboard. ***
  264.  
  265. To go directly into the game, bypassing the intro screen, use 
  266.    the command GO from the DOS prompt.  ex. GINRUMMY ok JOHN go
  267.  
  268. Since the game looks only at the first four parameters, too much 
  269.    garbage on the command line might miss a legitimate option: 
  270.    GINRUMMY 1 2 3 4 GO  will NOT execute the GO command.
  271.  
  272. These options can be put in any order and are all case insensitive
  273.    except for the Player Name.
  274.  
  275.  
  276. Game Play:
  277.      To start play, a player must draw a card from either the
  278. Deck or the Discard pile.  To do this, click the mouse pointer on
  279. the deck or on the discard pile on the playing screen, OR click
  280. on the words DECK or DISCARD PILE in the red boxes at the bottom
  281. of the screen.  In keyboard mode, type the highlighted letters 'D'
  282. for DECK, or 'P' for DISCARD PILE to choose.
  283.      You then must choose a card to discard.  Click the mouse
  284. pointer on the card in your hand that you want to discard 
  285. (the card you want to replace with your drawn card).  To do this 
  286. in keyboard mode, the numbers 1 2 3 4 5 6 7 8 9 0 appear under 
  287. your hand.  Choose the number under the card you want to discard, 
  288. or you can discard the drawn card by clicking on the discard pile, 
  289. on the words DRAWN CARD in the red box at the bottom of the screen, 
  290. or type 'D' in keyboard mode.  If the drawn card is taken from the
  291. discard pile, you can undo the draw by clicking on the card drawn,
  292. or within box around UNDO, or by typing 'U' on the keyboard.
  293.      After you discard, the computer will draw and discard. 
  294. Play continues until one of you gins, knocks, or draws the last
  295. card in the deck.  You can also type 'Q' or click on the QUIT 
  296. option in a red box at the bottom right of the screen to return,
  297. upon confirmation, to the title screen.  Double-clicking on the 
  298. QUIT option will also send you to the title screen.
  299.      If after you discard, the total points remaining in your
  300. hand are equal to or less than the knock value, you will be asked
  301. if you want to knock.  Click on YES, or on the knock card, to end
  302. the game with a knock. Click on NO, or on the discard pile, to
  303. continue the game without knocking.  Keyboard mode highlights
  304. the 'Y' and 'N' for choosing yes or no.  If you have disabled 
  305. knocking, this question will not appear.
  306.      After one of you wins a hand, scores are accumulated until
  307. reaching the limit set at the title screen, whereupon one of you
  308. wins the game.  You can then play again from zero or quit to the
  309. main intro menu.
  310.  
  311.  
  312. The Color Bars -
  313.      To help you see how your cards are arranged, the computer
  314. will draw colored bars above your matched cards.  The computer
  315. sorts the cards in your hand into the arrangement that gives you
  316. the lowest deadwood score (or it tries to).  Above all cards in 
  317. your hand that are matched into sets of 3 or 4 of a kind, a BLUE
  318. bar will be drawn.  Above the cards matched into a run will be 
  319. drawn a GREEN bar. 
  320.       If the COMPUTER player draws from the discard pile instead
  321. of the deck, a RED bar will be put over the discard pile until
  322. the next turn.  This means that the computer took the card that 
  323. you just discarded.  Since the computer goes so fast, this is done
  324. to simulate a more realistic play in which you can see from where
  325. your opponent draws.
  326.       Also, if a player Knocks, and the other player can lay off
  327. some deadwood on the knocking player, a RED bar will be drawn
  328. over (or under) all the laid off cards.
  329.      When you choose for the computer to give you a hint on 
  330. drawing a card or when choosing a discard, a YELLOW bar will be 
  331. placed over the recommended place.
  332.  
  333.  
  334. The Score file -
  335.      At the end of each game, the program checks for a score file
  336. called GINRUMMY.SCR in the current directory.  If it is not there,
  337. it is created.  This file saves your 20 best average scores (the
  338. final score divided by the number of hands played).  Also saved
  339. is your name (you must use the command line name option, or change
  340. the default player name if you don't want 'PLAYER' saved as your
  341. name), the final score, the score limit, the number of hands played,
  342. whether the Oklahoma option is on or off (Y or N), and the date the
  343. game was played.  Scores are not saved for the Computer player.
  344. If your score file is corrupted, or you just want to clear the
  345. score list and start over, erase (or rename) the GINRUMMY.SCR file.
  346.  
  347. ******* If you quit a hand before the END of the game, the score
  348. file will NOT be updated. ********
  349.  
  350.  
  351. Notes on the Computer player -
  352.      The comnputer does NOT "cheat" when playing.  It does not
  353. look at the deck before choosing to draw, it does not look at
  354. your hand, or do any other thing that a human player cannot do.
  355. In fact, it is much more limited than a human player in that it
  356. does NOT remember any cards that have already been buried in the
  357. discard pile when trying to choose a discard.  Also, the computer
  358. chooses its discard by a set of fixed formulas that do not have
  359. any room for human "intuition" or for many of the different
  360. possible arrangements of the hand that might make a good human
  361. player choose a diffent discard than the computer.
  362.      The "Hint" function uses about the same formulas for choosing
  363. a discard that the computer uses for its moves.
  364.  
  365.  
  366. IF YOU HAVE A THREE BUTTON MOUSE, BUT THE CENTER BUTTON DOES NOT
  367. DO ANYTHING, you probably are using a different mouse driver than
  368. the one which came with your mouse.  A three button mouse MUST be
  369. driven by a three button mouse driver (like Logitech).  Most of
  370. the Microsoft mouse driver programs are for two button rodents.
  371. They seem to work fine for all operations of the mouse except for
  372. the center button.  If you have a problem, look around the BBS's 
  373. for a newer mouse driver, (I use Logitech mouse driver ver. 6.00)
  374. or contact the company where you purchased your mouse.
  375.  
  376. ==================================================================
  377. This program is written in Turbo Pascal Version 6.0
  378. The Mouse unit is from the book "Turbo Pascal Advanced Programer's
  379. Guide" by Stephen K. O'Brian.  This unit was slightly modified by me.
  380.  
  381. Feel free to upload and share this shareware program with everyone.
  382.  
  383. Please call me if you have any questions, comments, improvements, 
  384. or find any bugs.  
  385.  
  386. David Teach  -  Phone: (813) 968-5986    CompuServe ID: 70743,2753
  387. ==================================================================
  388.  
  389. Version History:
  390.  
  391.      Ver 3.0  -  01/14/92 - (Enhancements for widespread release)
  392.        - added hints button/key for tips on drawing and discarding.
  393.        - now supports monochrome EGA and VGA graphics.
  394.        - you can now undo an accidental draw from the discard pile.
  395.        - improved the computer's drawing/discarding choice routines.
  396.        - replaced non-working help with high scores box on main screen.
  397.        - increased saved high scores from 10 to 20. 
  398.        - you can now view the high scores from within the program, 
  399.            instead of only when exiting.
  400.        - changing the mouse pointer shape is now done from the
  401.            options menu.
  402.        - fixed a minor bug that gave the wrong ranking when creating
  403.            a new high score file.
  404.        - fixed some bugs when sorting cards in a certain arrangements.
  405.  
  406.      Ver 2.4  -  10/07/91 - (More options to choose from)
  407.        - uncluttered the title screen by adding an Options Menu.
  408.        - you can now save (almost) all of the game options to disk.
  409.        - changed to new mouse driver unit for better mouse function.
  410.        - there are now 7 different mouse cursors to choose from.
  411.        - unsorted cards can be in either Rank or Suit order.
  412.        - knocking can be disabled. (play until Gin)
  413.        - put cards of same value, when sorting by rank, into bridge
  414.            suit order: spades, hearts, diamonds, and clubs.
  415.        - fixed a bug in card sorting that would not take a card
  416.            off of the end of a run when there was a match possible
  417.            with two unused cards.
  418.  
  419.      Ver 2.3  -  05/07/91 - (A few enhancements and bug fixes)
  420.        - changed the single color bars to a solid bar over the
  421.            entire run or set, to help disinguish each set.
  422.        - added a cursor when changing your name from main menu.
  423.        - better working when mouse and keyboard are both active.
  424.        - fixed a bug that put a green bar insead of a blue bar
  425.            over 4 of a kind sets.
  426.        - fixed a VGA to EGA conversion bug that did not draw the
  427.            red bar over the discard pile when computer picked
  428.            from it.
  429.        - fixed a bug where you sometimes could not exit the game
  430.            after pressing a few keyboard keys when in mouse mode.
  431.        - fixed a minor bug when double-clicking the quit box.
  432.        - GinRummy is now Copyrighted 1991.
  433.  
  434.      Ver 2.2  -  04/26/91 - (EGA, keyboard, easy, keyboard options)
  435.        - only an EGA or better video card is now required.
  436.        - GinRummy can now be played using either the mouse or
  437.            the keyboard.
  438.        - added the KEYBOARD option for false mouse detection.
  439.        - added the option for an EASY computer player for wimps.
  440.        - changed the KNOCK card and the QUIT box displays.
  441.        - put a red box on the knock card when it is a spade and
  442.            the Oklahoma option is active.
  443.  
  444.      Ver 2.1  -  03/24/91 - (A quick bug fix, some improvements)
  445.        - added a counter on the screen for number of hands played.
  446.        - when changing the score limit from the intro screen, the 
  447.            left and right mouse buttons now decrease or increase
  448.            the score limit. (respectively)
  449.        - fixed bug when printing scores over 999.
  450.        - fixed a bug in the number of hands counter when quitting
  451.            to the intro screen, and then beginning another game.
  452.            (Discovered about 20 minutes after releasing Ver 2.0)
  453.        - more room allocated on the stack for recursive procedure
  454.            calling, (say what?) to eliminate occasional hangs.
  455.        - misc. code streamlining for faster play.
  456.  
  457.      Ver 2.0  -  03/22/91 - (Bug fix, Name, Stats, Harder Opponent)
  458.        - made the computer player much smarter at discarding.
  459.            Having the computer choose better when discarding, you
  460.            now face a MUCH tougher opponent than before.
  461.        - added a score file to save ten best average game scores.
  462.        - can now input/change player's name in main menu.
  463.        - can now use left or right buttons to play.
  464.        - improved the card sorting and hand ordering for both players.
  465.        - now shows the points scored when undercutting.
  466.        - improved the BIG cards appearance. (Diamonds at least)
  467.        - fixed a major bug in the Oklahoma option scoring that occurs 
  468.            when drawing the first card of the discard pile if it is a 
  469.            spade and the discard is not, or vise versa. (Thanks Kevin)
  470.        - fixed a bug that incorectly counted the score when laying
  471.            of a face card.
  472.        - fixed a bug where the game would not end if a player's
  473.            score was exactly the same as the game score limit.
  474.        - fixed a bug that would not correctly lay off cards if the
  475.            knocking player had two or more consecutive runs.
  476.        - did a general playability refinement, and many misc changes.
  477.  
  478.      Ver 1.2  -  02/01/91 - (A few needed options for better play.)
  479.        - added the GO command line option.
  480.        - added the counter of cards left in deck.
  481.        - added option for the player's name.
  482.        - shows the score limit during play.
  483.  
  484.      Ver 1.1  -  01/19/91 - (Requested by Paul Schoenberger of
  485.        the Clearwater IBM Users Group, Board of Directors.)
  486.        - added the option for big cards.
  487.        - added command line options.
  488.        - added version number for future releases.
  489.  
  490.      First Uploaded Release (no version number) - 12/03/90
  491.        - fixed a bug in the discard pile.
  492.        - minor playing changes.
  493.  
  494.      USF Engineering Technology Senior Project - 08/05/90  (Grade: A)
  495.        - first playable version.
  496.  
  497.